<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
	<style type="text/css">
		*{
			margin: 0;
			padding: 0;
		}
		.box{
			width: 1200px;
			margin: 0 auto;
			background-color: pink;
		}
		.only{
			width: 280px;
			height: 320px;
			background-color: red;
			margin: 10px;
			float: left;
		}
		h2{
			width: 1200px;
			padding: 10px;
/*			background-color: orange;*/
/*			margin: 0 auto;*/
			box-sizing: border-box;
		}
		.clear{
			clear: both;
/*			专门用来清除 浮动带来的影响 隔墙法*/
		}
		/*.box::after{
			content: "";
			clear: both;
			display: block;*/
/*		}*/
		.clearFix::after{
			content: "";
			clear: both;
			display: block;
		}
	</style>
</head>
<body>
	<!-- 给浮动元素的父级 添加清除浮动的类名 伪元素清除法 -->
	<div class="box clearFix">
		<div class="only"></div>
		<div class="only"></div>
		<div class="only"></div>
		<!-- <div class="clear"></div> -->
	</div>
	<div class="one clearFix">
		<div class="only"></div>
		<div class="only"></div>
		<div class="only"></div>
		<!-- <div class="clear"></div> -->
	</div>
	<h2>我是标题</h2>
</body>
</html>